---
title: Save hearing request / update case
summary: Persists a hearing-request case, creating audit case notes on attorney/firm changes, validating consolidation membership changes, and triggering downstream sync and letter operations on success.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: OP-LGL-008
trigger: clsRequestManager.OnWrite (case Save)
---

# Save hearing request update case

This operation is the `OnWrite` save path for a hearing-request case: it attaches file locations for new cases, records audit case notes when the worker attorney or firm changes, validates consolidation membership changes, saves the case, and then triggers WCD sync and an optional recon-request letter.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-LGL-008 |
| **Trigger** | `clsRequestManager.OnWrite` (case Save) |
| **Inputs** | `CurrentCase`, prior firm/attorney IDs loaded at retrieve time |
| **Outputs** | Saved case; audit case notes; recon-request letter request; WCD Guidewire sync |
| **Primary components** | `clsRequestManager.OnWrite` |
| **Entry point** | `SAIF.Application.Claim.Legal\LegalNet\clsRequestManager.vb` |

## Steps

1. On a new case: attach a "Located at" file location (`LOUN`).
2. On an existing case: compare the loaded firm/attorney IDs against the current values.
   - If `OldFirmId <> CurrentCase.WorkerAttorneyFirmID`: create a firm-changed audit case note (`CreateFirmChangedCaseNote` → `CreateCaseNote`, `CategoryCode = "RFH"`, `CreateUser = "SYSTEM"`) ([BR-LGL-009](../business-rules.md#br-lgl-009-worker-attorney-firm-change-creates-a-system-audit-case-note)).
   - If `OldAttorneyId <> CurrentCase.WorkerAttorneyID`: create an attorney-changed audit case note (`CreateAttorneyChangedCaseNote` → `CreateCaseNote`, `CategoryCode = "RFH"`, `CreateUser = "SYSTEM"`) ([BR-LGL-010](../business-rules.md#br-lgl-010-worker-attorney-change-creates-a-system-audit-case-note)).
3. On a new case with `SendReconRequest` set: set `ReconLetterMailedDate = Today`.
4. If consolidation membership changed (and the case itself is not otherwise dirty): call `CurrentCase.Consolidations.ConsolidateCases(DPI)`.

   > **Origin**: delegates to `SAIF.Business.Claim.Legal` (see [operations and processes](../../saif-business-claim-legal/operations-processes.md)) — the internal step sequence of `Consolidations.ConsolidateCases` was not traced in this run's Stage 1 analysis; this callout is inferred/best-effort.*
   - If the call throws with a message containing "Schedule date must be in the future": short-circuit with `AppendMessage("Error: One or more hearing rows are in 'Set' or 'Reset' status and scheduled in the past")` (message excerpt) and return `False` from the save, instead of propagating the raw exception ([BR-LGL-011](../business-rules.md#br-lgl-011-consolidation-is-rejected-when-a-hearing-is-scheduled-in-the-past-for-a-set-reset-case)).
   - Any other exception message: rethrown unhandled.
5. Save the case.
   - On success:
     - Sync WCD data — see [Sync WCD number to Guidewire](sync-wcd-number-to-guidewire.md).
     - If `SendReconRequest` was set: call [Insert letter request](insert-letter-request.md) for a recon-request letter, then submit an Appworx letter job — see [Submit letter print batch job](submit-letter-print-batch-job.md) ([SQL-001](../sql/SQL-001-insert-letter-request.md)).
     - Reload the case list/current case.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([OnWrite invoked]) --> New{New case?}
	New -->|Yes| Loun[Attach LOUN file location]
	New -->|No| Compare[Compare loaded vs current<br>firm/attorney IDs]
	Compare --> FirmChg{Firm changed?}
	FirmChg -->|Yes| FirmNote[Create firm-changed<br>audit case note]
	FirmChg -->|No| AttyChg{Attorney changed?}
	FirmNote --> AttyChg
	AttyChg -->|Yes| AttyNote[Create attorney-changed<br>audit case note]
	AttyChg -->|No| Recon
	AttyNote --> Recon{New case with<br>SendReconRequest?}
	Loun --> Recon
	Recon -->|Yes| SetDate[Set ReconLetterMailedDate = Today]
	Recon -->|No| ConsolChk
	SetDate --> ConsolChk{Consolidation<br>membership changed?}
	ConsolChk -->|Yes| Consol[ConsolidateCases]
	ConsolChk -->|No| Save
	Consol --> ConsolOk{Threw past-hearing error?}
	ConsolOk -->|Yes| Reject([Reject: hearing scheduled<br>in the past, Set/Reset])
	ConsolOk -->|No, other error| Rethrow([Rethrow unhandled])
	ConsolOk -->|No error| Save[Save case]
	Save --> SaveOk{Succeeded?}
	SaveOk -->|Yes| Wcd[Sync WCD to Guidewire]
	SaveOk -->|No| EndErr([Return False])
	Wcd --> ReconSend{SendReconRequest set?}
	ReconSend -->|Yes| Letter[Insert letter request +<br>Appworx batch job]
	ReconSend -->|No| Reload
	Letter --> Reload[Reload case list/current case]
	Reload --> EndOk([Done])
```

## Failure and edge-case behavior

- Consolidation rejected due to a past-scheduled hearing in Set/Reset status: a user-facing error is appended and the save returns `False` ([BR-LGL-011](../business-rules.md#br-lgl-011-consolidation-is-rejected-when-a-hearing-is-scheduled-in-the-past-for-a-set-reset-case)); any other consolidation exception message is rethrown unhandled.
- WCD sync and recon-letter submission occur only after a successful case save.
- WCD Guidewire sync failures never fail this save ([BR-LGL-008](../business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save)).

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Application.Claim.Legal\LegalNet\clsRequestManager.vb`
